<%@ include file="top.jsp" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.Calendar" %>
<%@ page import="icom.acm.bean.T_USER" %>
<%@ page import="icom.acm.bean.T_U_BASEINFO" %>
<%@ page import="icom.acm.manager.T_U_BaseInfoMgr" %>
<%
T_USER user = (T_USER)session.getAttribute("user");
if (user == null) return ;
if (user.getU_ROLE()<0 ) return ;
String token = java.util.UUID.randomUUID().toString();
session.setAttribute("token", token);

T_U_BaseInfoMgr ubiMgr = new T_U_BaseInfoMgr();
T_U_BASEINFO ubi = ubiMgr.GetUserInfo(user.getU_ID());

Calendar cal= Calendar.getInstance(); 
cal.setTime(ubi.getU_BIRTHDAY()); 

int year = cal.get(Calendar.YEAR);//ubi.getU_BIRTHDAY().getFullYear();
int month = cal.get(Calendar.MONTH) + 1;//ubi.getU_BIRTHDAY().getMonth();
int day = cal.get(Calendar.DAY_OF_MONTH);//ubi.getU_BIRTHDAY().getDay();
String url = ubi.getU_BLOGURL();

if(ubi.getU_BLOGURL() == null){
	url = "http://";
}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" href="jquery/css/smoothness/jquery-ui-1.8.20.custom.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="jquery/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="jquery/themes/icon.css">
<link rel="stylesheet" type="text/css" href="jquery/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="jquery/themes/default/messager.css">
<link rel="stylesheet" type="text/css" href="jquery/themes/default/accordion.css">

<script type="text/javascript" src="jquery/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="jquery/js/jquery-ui-1.8.20.custom.min.js"></script>

<title>基本信息</title>
</head>


<body class="sub" style="background:#F0FFF0;">
<form action="UserBaseInfo_insertUpdateUBI" method="post" name="userbaseinfo" id="form1">
  <table width="90%" border="0" cellpadding="4">
    <tr>
      <td colspan="3" class="HeaderColor">        <h4>基本信息修改</h4>      </td>
    </tr>
    <tr style="vertical-align: top">
      <td class="LabelColor" style="text-align: right">
        <label for="username">所在地:</label>      </td>
      <td colspan="2" class="TitleColor"><input type="text" name="UBI.U_ADDRESS" value="<%=ubi.getU_ADDRESS() %>">
      </td>
    </tr>
    <tr style="vertical-align: top">
      <td style="text-align: right" class="LabelColor">
        <label for="password">性别:</label>      </td>
      <td colspan="2" class="TitleColor">&nbsp;<label for="male">男 </label>
      <%
      if(ubi.getU_SEX().equals("男")){
      %>
        <input type="radio"  name="UBI.U_SEX" value="男" checked>
        <%}else{
        	
        %>
         <input type="radio"  name="UBI.U_SEX" value="男">
        <%} %>
        <label for="female">女 </label>
        <%
      if(ubi.getU_SEX().equals("女")){
      %>
        <input type="radio"  name="UBI.U_SEX" value="女" checked>
        <%}else{
        	
        %>
         <input type="radio"  name="UBI.U_SEX" value="女">
        <%} %>
        </td>
    </tr>
    <tr style="vertical-align: top">
      <td style="text-align: right" class="LabelColor">        生日:</td>
      <td colspan="2"><table border="0" cellspacing="2" cellpadding="0">
          <tr style="text-align: left">
			<td class="TitleColor">
              <label for="year">年: </label>
              <select name="year">
                 <option value ="<%=year %>"><%=year %></option>
                 <%
                 for(int i = 1975; i < 2013; ++i)
                 {
                	 if(i == year) continue;
                %>
                <option value ="<%=i %>"><%=i %></option>
                 <% }%>

                 </select>    
              </td>          
            <td class="TitleColor">
              &nbsp;<label for="month">月: </label>
              <select name="month">
             <option value ="<%=month %>"><%=month %></option>
			  <%
                 for(int i = 1; i < 13; ++i)
                 {
                	 if(i == month)continue;
                %>
                <option value ="<%=i %>"><%=i %></option>
                 <% }%>
             </select>
              </td>
            <td class="TitleColor">
              <label for="day">日: </label>
              <select name="day">
             <option value ="<%=day %>"><%=day %></option>
              <%
                 for(int i = 1; i < 32; ++i)
                 {
                	 if(day == i)continue;
                %>
                <option value ="<%=i %>"><%=i %></option>
                 <% }%>
             </select>
              </td>            
          </tr>
        </table>      </td>
    </tr>
    <tr style="vertical-align: top">
      <td style="text-align: right" class="LabelColor">
        <label for="email"> 博客地址:</label>      </td>
      <td colspan="2" class="TitleColor"><input type="text" name="UBI.U_BLOGURL" size="50" value="<%=url %>"/></td>
    </tr>
    <tr style="vertical-align: top">
      <td style="text-align: right" class="LabelColor">       联系方式:</td>
      <td colspan="2" class="TitleColor"><label for="first">QQ: </label>
          <input type="text" id="first" name="UBI.U_QQ" value="<%=ubi.getU_QQ() %>">      <label for="last">MSN: </label>
          <input type="text" id="last" name="UBI.U_MSN" value="<%=ubi.getU_MSN() %>">      </td>
    </tr>
    <tr style="vertical-align: top">
      <td style="text-align: right" class="LabelColor">        简介:</td>
      <td colspan="2"><textarea cols="20" rows="4" name="UBI.U_STATEMENT"><%=ubi.getU_STATEMENT() %></textarea></td>
    </tr>
    <tr>
    <td>
    <input type="hidden" name="UBI.U_ID" value="<%=user.getU_ID() %>">
    <input type="hidden" name="token" value="<%=token %>">
    </td>
    </tr>
    <tr style="vertical-align: top" class="FooterColor">
      <td colspan="3" align="center">
        <a id="asubmit" class="easyui-linkbutton" onclick="document.getElementById('userbaseinfo').submit();">修改</a>
	  </td>
    </tr>
  </table>
</form>
</body>

</html>